# -*- coding = utf-8 -*-
# @Time    : 2025/3/29 下午3:52
# @Author  : yqk
# @File    : 协程.py
# @Software: PyCharm

import asyncio
import time


async def singing():
    print('开始唱歌')
    time.sleep(1)
    print('结束唱歌')

async def dancing():
    print('开始跳舞')
    time.sleep(1)
    print('结束跳舞')

async def main():
    # await singing()
    # await dancing()
    #并发协程
    task1 = asyncio.create_task(singing())
    task2 = asyncio.create_task(dancing())
    await asyncio.wait([task1, task2])

if __name__ == '__main__':
    asyncio.run(main())
